% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assignment_column.r
\name{assignment_column}
\alias{assignment_column}
\title{Assign observations to zone or area
person("Melanie", "Harsch", role = c("aut"))}
\usage{
assignment_column(
  dat,
  gridfile,
  hull.polygon,
  lon.dat,
  lat.dat,
  categ,
  closest.pt,
  lon.grid,
  lat.grid
)
}
\arguments{
\item{dat}{Main data frame containing data on hauls or trips. Table in 
fishset_db database should contain the string `MainDataTable`.}

\item{gridfile}{Spatial data. Shape, json, and csv formats are supported.}

\item{hull.polygon}{T/F If TRUE, creates convex hull polygon. Use if spatial
data creating polygon are sparse or irregular.}

\item{lon.dat}{Column containing longitude data in main data frame.}

\item{lat.dat}{Column containing latitude data in main data frame.}

\item{categ}{Column in gridfile that identifies the individual areas or zones.
If gridfile is class sf, `categ` should be name of list containing
information on zones.}

\item{closest.pt}{TRUE/FALSE If true, zone ID identified as the closest
polygon to the point.}

\item{lon.grid}{If gridfile is not shape or json file, specify column 
containing longitude data in gridfile.}

\item{lat.grid}{If gridfile is not shape or json file, specify column 
containing latitude data in gridfile.}
}
\value{
Main data frame with new assignment column labeled zoneID.
}
\description{
Assign observations to zone or area
person("Melanie", "Harsch", role = c("aut"))
}
\details{
Assign each observation to zones defined by a spatial data
    set.
Converts point data from gridfile into polygons and then finds which polygon
    each observation in the main data frame is within. Use hull.polygon=T
    if data is sparse or irregular.
}
\keyword{polygon}
\keyword{zone,}
